﻿package
{
	import org.flixel.*;
	
	public class Player extends masa
	{
		//[Embed(source="data/player.png")] private var ImgPlayer:Class;
		//[Embed(source="data/salto.mp3")] private var SoundJump:Class;
	
		public function Player(X:Number, Y:Number, allCharges:FlxGroup)
		{
			super(X, Y, 0, allCharges);
			
			moves = true;
			immovable = false;
			
			//tweak the bounding box for better feel
	
			}
		
		override public function update():void
		{
			//Smooth slidey walking controls
			super.update();
				
			if(FlxG.keys.justPressed("A"))
				charge = -25;
			if(FlxG.keys.justPressed("S"))
				charge = 0;			
			if(FlxG.keys.justPressed("D"))
				charge = 25;
			
			if(FlxG.keys.LEFT)
					acceleration.x -= drag.x;
			if(FlxG.keys.RIGHT)
					acceleration.x += drag.x;		
			if(FlxG.keys.UP)		
					acceleration.y -= drag.y;		
			if(FlxG.keys.DOWN)		
					acceleration.y += drag.y;				
					
			
			//if(FlxG.keys.justReleased("Z")
			//facing = LEFT;
			//if(wallJump)if(isTouching(LEFT))velocity.x += drag.x*0.3
			//angle:Number; y ver otras funciones para girar, flxobject
			//touching:uint; 
			//allowCollisions:uint; left right up down
			//getScreenXY
			//flicker
			
			
		}
		
	}
}
